/**
 * 
 */
(function($)
{
	$.fn.slidemenu = function()
	{
		$.prototype.createMenuList = function()
		{
			menulist.attr('class', 'slidemenu_list');
			
			menulist.css('display', 'none');
			
			menulist.insertAfter(this);
		};
		
		$.prototype.addMenu = function(name, customs)
		{
			var menu = $('<li></li>').appendTo(menulist);
			
			menu.html(name);
			
			menu.click({slidemenu : this, customs : customs}, function(e)
			{
				e.data.slidemenu.trigger('select', e.data.customs);
			});
			
			return menu;
		};
		
		$.prototype.clearMenu = function()
		{
			menulist.empty();
		};
		
		this.click(function()
		{
			menulist.slideToggle('medium');
		});
		
		menulist = $('<ul></ul>');
		
		this.createMenuList();
	};
})(jQuery);